package com.qc.toutiao.services.impl;

import org.apache.ibatis.session.SqlSession;

import com.qc.toutiao.dao.UserinfoMapper;
import com.qc.toutiao.pojo.Userinfo;
import com.qc.toutiao.services.UserInfoService;
import com.qc.toutiao.util.SessionUtil;

public class UserInfoServiceImpl implements UserInfoService{
	
	SqlSession session;
	UserinfoMapper userinfoMapper;
	SessionUtil su = new SessionUtil();
	
	public UserInfoServiceImpl(){
		session = su.getSession();
		userinfoMapper = session.getMapper(UserinfoMapper.class);
	}

	@Override
	public Userinfo findUserLogin(String account, String password) {
		
		Userinfo userInfo = userinfoMapper.findUserLogin(account,password);
		
		//su.closeSession(session);
		
		return userInfo;
	}

}
